/*
 * @authors :wcj
 * @date    :2017-08-22
 * @description：PC端 -企业换、购票列表
 */

import { BARTER,BARTER_CONCAT,BUY,BUY_CONCAT} from '../../actions/Draft/list';

const initState = {
   barter:[],
   buy:[],
}; 

export default function (state = initState, action) {
    switch (action.type) {

        case BARTER: //换票 -  默认 全部，1=大换小，2=小换大
            return Object.assign({}, state, {barter: action.data });

        case BARTER_CONCAT: //换票 -  分页
            return Object.assign({}, state, {barter: state.barter.concat(action.data) });

        case BUY: //购票 -  默认 全部，1=大换小，2=小换大
            return Object.assign({}, state, {buy: action.data });

        case BUY_CONCAT: //换票 -  分页
            return Object.assign({}, state, {buy: state.buy.concat(action.data) });

        default:
            return state;    
    }
}